package hc.core;

import hc.core.util.Stack;

public class Ack {
	int waitStart, waitEnd;
	Ack next;
	
	final private static Stack free = new Stack();
	private static short stackSize = 0;

	public final static Ack getFree(){
		Ack packate = null;
		synchronized (free) {
			if(stackSize == 0){
//				hc.core.L.V=hc.core.L.O?false:LogManager.log("------MEM ALLOCATE [Message]------");
				packate = new Ack();
			}else{
				packate = (Ack)free.pop();
				stackSize--;
			}
			return packate;
        }
	}
	
	public final static void cycle(Ack dp){
		synchronized (free) {
			free.push(dp);
			stackSize++;
        }		
	}

}
